package com.nimitz.module.demo.domain;

import com.nimitz.common.annotation.Excel;
import com.nimitz.common.annotation.Excel.Type;
import com.nimitz.common.annotation.Excels;
import com.nimitz.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.List;

/**
 * 订单表 dem_order
 */
@ApiModel(value = "DemOrder对象", description = "订单表")
public class DemOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 订单id
     */
    @ApiModelProperty(value = "订单id")
    private Integer orderId;

    /**
     * 订单编码
     */
    @Excel(name = "订单编码")
    @ApiModelProperty(value = "订单编码")
    private String orderCode;

    /**
     * 用戶id
     */
    @ApiModelProperty(value = "用戶id")
    private Integer userId;

    /**
     * 用户对象
     */
    @Excels({@Excel(name = "用户名称", targetAttr = "userName", type = Type.EXPORT),
            @Excel(name = "用户编码", targetAttr = "userCode", type = Type.EXPORT)})
    private DemUser user;

    /**
     * 订单详情集合
     */
    private List<DemOrderDetail> details;

    /**
     * 删除标志：0存在；1删除
     */
    private String delFlag;

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public DemUser getUser() {
        return user;
    }

    public void setUser(DemUser user) {
        this.user = user;
    }

    public List<DemOrderDetail> getDetails() {
        return details;
    }

    public void setDetails(List<DemOrderDetail> details) {
        this.details = details;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("orderId", getOrderId())
                .append("orderCode", getOrderCode())
                .append("userId", getUserId())
                .append("user", getUser())
                .append("details", getDetails())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
